public class test {
    // dd爱框框
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int x = in.nextInt();
        long sum = 0;
        int len = Integer.MAX_VALUE;
        int[] nums = new int[n + 5];
//记录最短的[l,r]
        int l = 0;
        int r = 0;
//滑动窗口的两端
        int left = 1;
        int right = 1;
        for(int i = 1;i <= n;i++){
            nums[i] = in.nextInt();
            sum += nums[i];
            while(sum >= x){
//找到新的最小区间
                if(right - left < len){
                    len = right - left;
                    l = left;
                    r = right;
                }
                sum -= nums[left++];
            }
            right++;
        }System.out.println(l + " " + r);
    }
    // 除 2!
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int x = in.nextInt();
        long sum = 0;
        int len = Integer.MAX_VALUE;
        int[] nums = new int[n + 5];
//记录最短的[l,r]
        int l = 0;
        int r = 0;
//滑动窗口的两端
        int left = 1;
        int right = 1;
        for(int i = 1;i <= n;i++){
            nums[i] = in.nextInt();
            sum += nums[i];
            while(sum >= x){
//找到新的最小区间
                if(right - left < len){
                    len = right - left;
                    l = left;
                    r = right;
                }
                sum -= nums[left++];
            }
            right++;
        }System.out.println(l + " " + r);
    }
    // 单词搜索
    //深度优先搜索
    public int[] dx = {0,0,1,-1};
    public int[] dy = {1,-1,0,0};
    public boolean[][] count;
    public char[][] nums;
    public String words;
    public int len;
    public int row;
    public int col;
    public boolean exist (String[] board, String word) {
        words = word;
        len = word.length();
        row = board.length;
        col = board[0].length();
        nums = new char[row][col];
        count = new boolean[row][col];
        for(int i = 0;i < board.length;i++){
            nums[i] = board[i].toCharArray();
        }
        char key = word.charAt(0);
        for(int i = 0;i < row;i++){
            for(int j = 0;j < col;j++){
                if(nums[i][j] == key){
                    count[i][j] = true;
                    if(dfs(i,j,1)){
                        return true;
                    }
//恢复现场
                    count[i][j] = false;
                }
            }
        }
        return false;
    }
    // 当前位置的x,y和需要寻找的字符index
    public boolean dfs(int ix,int iy,int index){
        if(index == len){
            return true;
        }
        for(int i = 0;i < 4;i++){
            int x = ix + dx[i];
            int y = iy + dy[i];
// 1. x,y不越界
// 2. 此次搜索中,当前位置未走过
// 3. 为此时想要找的字母
            if(x >= 0 && x < row && y >= 0 && y < col && !count[x][y] && nums[x][y] == words.charAt(index)){
                count[x][y] = true;
                if(dfs(x,y,index + 1)){
                    return true;
                }
                count[x][y] = false;
            }
        }
        return false;
    }
}
